package com.itheima.day10_WZRY;

import java.io.*;

public class Demo1 implements Serializable {
    private String name;
    private int age;

    public Demo1() {
    }

    public Demo1(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static void main(String[] args) throws Exception {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("obj.txt"));
        oos.writeObject(new Demo1());
    }
}
